package com.house.java.util;

import java.sql.Date;

import com.house.java.model.HistoryPrice;

public class HistoryPriceUtils {

	
	public void setHistoryPrice(HistoryPrice price,String fieldName,String fieldValue){
		if(StringUtils.hasLength(fieldValue) && StringUtils.hasLength(fieldName)){
			
		}
	}
	
	/**
	 * 根据属性名设置HistoryPrice的属性值
	 * @param house
	 */
	public void setFieldForHistoryPrice(HistoryPrice price,String fieldName,String fieldValue){
		if("historyTime".equals(fieldName)){
			price.setHistoryTime(Date.valueOf(fieldValue));
		}else if("maxPrice".equals(fieldName)){
			price.setMaxPrice(Integer.parseInt(fieldValue));
		}else if("avgPrice".equals(fieldName)){
			price.setAvgPrice(Integer.parseInt(fieldValue));
		}else if("minPrice".equals(fieldName)){
			price.setMinPrice(Integer.parseInt(fieldValue));
		}else if("priceDesc".equals(fieldName)){
			price.setPriceDesc(fieldValue);
		}
	}
}
